-- check_str
--
local import = import
---@type behavior_ret
local bret = import("bt/bt_plugin/behavior3/behavior_ret")

local M = {
    name = "check_str",
    type = "Condition",
    desc = "检查字符串",
    args = {
        { "str", "string", "判断的字符串" }
    },
    input = { "输入字符串变量" }
}

function M.run(node, env, value)
    if not value then
        return bret.FAIL
    end
    local str = node.args.str
    if value == str then
        return bret.SUCCESS
    end
    return bret.FAIL
end

return M
